package com.xcdh.ittools.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TestService {

    public void method1(){
        System.out.println("=========");
    }

    @Async("taskExecutor")
    public void asyncMethod1(){
        try {
            Thread.sleep(5000);
            System.out.println("=====asyncMethod1====");
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    @Transactional
    public void tx1(){
        
    }

    @Transactional
    public void tx2(){
        System.out.println("=====");
    }
}
